home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Borland / Borland C++ V5.02 / PAL.PAK / PAL.CPP < prev    next >
C/C++ Source or Header  |  1997-05-06  |  2KB  |  89 lines

  1. // pal.cpp : Implementation of CPalApp and DLL registration.
  2. //
  3. // This is a part of the Microsoft Foundation Classes C++ library.
  4. // Copyright (C) 1992-1995 Microsoft Corporation
  5. // All rights reserved.
  6. //
  7. // This source code is only intended as a supplement to the
  8. // Microsoft Foundation Classes Reference and related
  9. // electronic documentation provided with the library.
  10. // See these sources for detailed information regarding the
  11. // Microsoft Foundation Classes product.
  12.  
  13. #include "stdafx.h"
  14. #include "pal.h"
  15.  
  16. #ifdef _DEBUG
  17. #undef THIS_FILE
  18. static char BASED_CODE THIS_FILE[] = __FILE__;
  19. #endif
  20.  
  21.  
  22. CPalApp NEAR theApp;
  23.  
  24. const GUID CDECL BASED_CODE _tlid =
  25.         { 0x5733f771, 0xbe58, 0x101a, { 0xb5, 0x7a, 0x0, 0x0, 0xc0, 0xc3, 0xed, 0x5f } };
  26. const WORD _wVerMajor = 1;
  27. const WORD _wVerMinor = 0;
  28.  
  29.  
  30. ////////////////////////////////////////////////////////////////////////////
  31. // CPalApp::InitInstance - DLL initialization
  32.  
  33. BOOL CPalApp::InitInstance()
  34. {
  35.     BOOL bInit = COleControlModule::InitInstance();
  36.  
  37.     if (bInit)
  38.     {
  39.         // TODO: Add your own module initialization code here.
  40.     }
  41.  
  42.     return bInit;
  43. }
  44.  
  45.  
  46. ////////////////////////////////////////////////////////////////////////////
  47. // CPalApp::ExitInstance - DLL termination
  48.  
  49. int CPalApp::ExitInstance()
  50. {
  51.     // TODO: Add your own module termination code here.
  52.  
  53.     return COleControlModule::ExitInstance();
  54. }
  55.  
  56.  
  57. /////////////////////////////////////////////////////////////////////////////
  58. // DllRegisterServer - Adds entries to the system registry
  59.  
  60. STDAPI DllRegisterServer(void)
  61. {
  62.     AFX_MANAGE_STATE(_afxModuleAddrThis);
  63.  
  64.     if (!AfxOleRegisterTypeLib(AfxGetInstanceHandle(), _tlid))
  65.         return ResultFromScode(SELFREG_E_TYPELIB);
  66.  
  67.     if (!COleObjectFactoryEx::UpdateRegistryAll(TRUE))
  68.         return ResultFromScode(SELFREG_E_CLASS);
  69.  
  70.     return NOERROR;
  71. }
  72.  
  73.  
  74. /////////////////////////////////////////////////////////////////////////////
  75. // DllUnregisterServer - Removes entries from the system registry
  76.  
  77. STDAPI DllUnregisterServer(void)
  78. {
  79.     AFX_MANAGE_STATE(_afxModuleAddrThis);
  80.  
  81.     if (!AfxOleUnregisterTypeLib(_tlid))
  82.         return ResultFromScode(SELFREG_E_TYPELIB);
  83.  
  84.     if (!COleObjectFactoryEx::UpdateRegistryAll(FALSE))
  85.         return ResultFromScode(SELFREG_E_CLASS);
  86.  
  87.     return NOERROR;
  88. }
  89.